package cn.dulian.spring5.testdemo;

import cn.dulian.spring5.bean.Book;
import cn.dulian.spring5.service.BookService;
import org.junit.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author dulian
 * @create 2022-04-15 22:45
 */
public class testJdbcTemplate {

    @Test
    public void testJdbcTemplate(){
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("bean1.xml");
        BookService bookService = context.getBean("bookService", BookService.class);
//        Book book = new Book();
//        book.setUserId(1);
//        book.setUsername("sdjflk32542345");
//        book.setUstatue("fa234534");
//        bookService.addBook(book);


//        Book book = new Book();
//        book.setUserId(1);
//        book.setUsername("sdjflk32542345");
//        book.setUstatue("fa234534");
//        bookService.updateBook(book);

//        bookService.deleteBook(1);
        bookService.selectCount();
        Book book = bookService.findBookInfo(2);
        System.out.println(book.toString());
    }
}
